#include <iostream>
#include <SFML/Graphics/RenderWindow.hpp>
#include <nice2d/application.h>
#include <nice2d/entity.h>

int main()
{
    auto window = std::make_shared<sf::RenderWindow>(sf::VideoMode(800, 600), "unit02",
                                                     sf::Style::Close);
    window->setVerticalSyncEnabled(true);

    auto app = Application::getInstance();
    app->setBackgroundColor(sf::Color::Blue);
    app->setWindow(window);

    auto parent = std::make_shared<Entity>();
    parent->setSize(300, 300);
    parent->setBackgroundColor(sf::Color::White);
    parent->setPosition(250, 150);

    auto object = std::make_shared<Entity>();
    object->setSize(200, 200);
    object->setBackgroundColor(sf::Color::Yellow);
    object->setPosition(100, 100);
    parent->addChild(object);

    auto child = std::make_shared<Entity>();
    child->setSize(100, 100);
    child->setBackgroundColor(sf::Color::Red);
    child->setPosition(100, 100);
    object->addChild(child);

    app->execute(parent);
    return 0;
}
